// number 类型 但是要排斥掉NaN
const isNumber = val => typeof val === 'number' && val === val;

console.log(isNumber(2)); // true
console.log(typeof NaN); // number
console.log(NaN == NaN); //false
console.log(isNumber(NaN)); // true